package org.objective.ddl.type;

import org.objective.ddl.*;

/**
 *
 * @author gus
 */
public final class DDLFieldInfo 
{
    private long fieldIndex;
    private String fieldName;
    private long   dataType;
    private long   size;
    private String defaultValue;
    private boolean primaryKey;
    private boolean unique;


    public DDLFieldInfo( long fieldIndex )
    {
        this.fieldIndex = fieldIndex;
        this.fieldName = NamigUtils.getFieldName(fieldIndex);
    }

    public DDLFieldInfo( String fieldName )
    {
        this.fieldIndex = DDLConstants.NullValue.ID;
        this.fieldName = fieldName;
    }

    public long getDataType()
    {
        return dataType;
    }

    public boolean isPrimaryKey()
    {
        return primaryKey;
    }

    public void setPrimaryKey(boolean primaryKey)
    {
        this.primaryKey = primaryKey;
    }

    public boolean isUnique()
    {
        return unique;
    }

    public void setUnique(boolean unique)
    {
        this.unique = unique;
    }

    
    public void setDataType( long dataType )
    {
        this.dataType = dataType;
    }

    public String getDefaultValue()
    {
        return defaultValue;
    }

    public void setDefaultValue( String defaultValue )
    {
        this.defaultValue = defaultValue;
    }

    public String getFieldName()
    {
        return fieldName;
    }

    public void setFieldName( String fieldName )
    {
        this.fieldName = fieldName;
    }

    public long getSize()
    {
        return size;
    }

    public void setSize( long size )
    {
        this.size = size;
    }
}
